/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package shaman.storage;

import java.util.List;
import javax.swing.table.AbstractTableModel;
import shaman.storage.api.Filter;

/**
 *
 * @author Shaman
 */
public class TableModelFilters extends AbstractTableModel {

    private List<Filter> Filters = null;

    public TableModelFilters(BackupTask task)
    {
        this.Filters = task.getFilters();
    }

    public int getRowCount() {
       return Filters.size();
    }

    public int getColumnCount() {
        return 1;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Filter CurFilter = Filters.get(rowIndex);
        switch (columnIndex)
        {
            case 0: return CurFilter.getName();
        }
        return "NONE";
    }

        @Override
    public String getColumnName(int col) {
        switch (col)
        {
            case 0: return "Имя фильтра";
        }
        return "NONE";
    }

    @Override
    public boolean isCellEditable(int row, int col) {
        return false;
    }

}
